home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
016a
/
x10_xa04.zip
/
XA.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-08-03
|
10KB
|
263 lines
#
# ┌─────────────────────────────────────────────────────────────────┐
# │ │
# │ XA - X10 Command Interpreter for the CP-290 - Version 1.04 │
# │ Copyright 1991 by Bruce Christensen. All Rights Reserved. │
# │ │
# └─────────────────────────────────────────────────────────────────┘
#
#──────────────────────────────────────────────────────────────────────────────
#
#
# IF NONE OF THIS MAKES SENSE....
# ....READ THE MANUAL (XA.TXT)
#
#
#──────────────────────────────────────────────────────────────────────────────
#
# <--This denotes the beginning of a comment. It is only recognized
# when it appears as the first character in a line
# ^--Blank lines are also ignored.
#
#──────────────────────────────────────────────────────────────────────────────
#
# The next token (ERASE) will remove all events from the CP-290
# memory. You are advised to use this when you use the DATE token for
# programming specific events. This ensures that when the event has
# passed, it will be deleted. Since every one of your events should
# be included in this file, there is no need to worry about erasing them
# now...they will be downloaded automatically.
ERASE
#
#──────────────────────────────────────────────────────────────────────────────
#
# PORT The serial communications port you will be using
# to talk to the computer interface.
# Choices: COM1 (default), COM2, COM3, and COM4.
PORT COM1
#
#──────────────────────────────────────────────────────────────────────────────
#
# DEFINES can be used to substitute several identifiers. They help
# make the commands more understandable.
# For instance, you define COMPUTER as HOUSE A UNIT 8 as follows:
#
DEFINE OUTSIDE_LIGHTS HOUSE A UNIT 1
DEFINE LIVING_ROOM_LAMP HOUSE A UNIT 2
DEFINE BEDROOM_LIGHT HOUSE A UNIT 3
DEFINE FAMILY_ROOM_LAMP HOUSE A UNIT 4
DEFINE FLAG HOUSE A UNIT 5
DEFINE COMPUTER A8
DEFINE DUSK SUNSET OFFSET 10
DEFINE DAWN OFFSET -30
# The following DEFINES were commented out:
#
#define xmas_computer house a unit 7
#define red house k unit 1
#define green house k unit 2
#define blue house l unit 1
#define white house l unit 2
# DEFINES must be declared before they are used in this file.
#
#──────────────────────────────────────────────────────────────────────────────
#
# The following are direct commands that are performed
# as soon as they are parsed (they are commented out).
#
#HOUSE A UNIT 2 OFF
#FAMILY_ROOM_LAMP ON
#
#──────────────────────────────────────────────────────────────────────────────
#
# LATITUDE You must use this command for accurate
# sunrise/sunset calculations. Positive values
# are used in the northern hemisphere, negative
# values for the southern hemisphere.
# LONGITUDE You must use this command for accurate
# sunrise/sunset calculations. Positive values
# are used west of Greenwich, negative
# east of Greenwich.
# These values may be obtained from almost any
# almanac, or consult your nearest library.
# For Mentor, OH:
# Latitude = 41°35'
# Longitude = 81°20'
#
# These values must be expressed as follows:
# 41d35m and 81d20m (or 41°35' / 81°20')
LATITUDE 41°35'
LONGITUDE 81°20'
#
#──────────────────────────────────────────────────────────────────────────────
#
# TIMEZONE Exact time calculations depend on the local time.
# Use the following chart to determine your timezone:
# Zone Use
# ==================== =========
# Eastern Standard Time: 5
# Eastern Daylight Time: 4
# Central Standard Time: 6
# Central Daylight Time: 5
# Mountain Standard Time: 7
# Mountain Daylight Time: 6
# Pacific Standard Time: 8
# Pacific Daylight Time: 7
#
TIMEZONE 4
#
#──────────────────────────────────────────────────────────────────────────────
#
# Set the X10 clock to the time and date of your PC's internal clock.
# Use the optional "EXACT" token to wait for the seconds counter to
# rollover to 0.
SYNCHRONIZE X10 EXACT
#
#──────────────────────────────────────────────────────────────────────────────
#
# Set the PC clock to the time of your X10's internal clock.
# Use the optional "EXACT" token to wait for the seconds counter to
# rollover to 0.
#
# Note: There is not enough information from the X10 to set the date.
#SYNCHRONIZE PC
#
#──────────────────────────────────────────────────────────────────────────────
#
# The following events will be downloaded to the CP-290 approximately
# one week before they are scheduled to occur (providing you run XA.EXE
# every week for updates). They turn on lights for the flag every evening
# on July 4, and off at sunrise on July 5 (every year). See the
# documentation for more information.
DATE 7/4/ FLAG ON SUNSET
DATE 7/5/ FLAG OFF SUNRISE
#
#──────────────────────────────────────────────────────────────────────────────
#
# The following are a set of commands that are downloaded weekly. See the
# documentation for full details - but here's a synopsis:
# Every Sunday morning at 3:00, the computer is turned on via X10. As
# DOS executes AUTOEXEC.BAT, a utility supplied with this package,
# POWERUP.EXE will return an ERRORLEVEL of 1 if the current time is
# within a range that you specify. This errorlevel can then be used to
# invoke XA.EXE to download another weeks worth of events, or you can use
# it to call other programs as well, for instance: backup programs,
# communications, etc. See the documentation for more details.
#
# Note the use of the SUNRISE and SUNSET tokens. These tokens will
# calculate the exact time of sunrise or sunset for your city assuming
# LATITUDE, LONGITUDE, and TIMEZONE were all entered correctly.
# This avoids having to constantly enter a new time for your outdoor lights.
SUNDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
SUN OFF SUNRISE OUTSIDE_LIGHTS
SUNDAY ON DUSK LIVING_ROOM_LAMP
SUNDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
SUNDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
SUNDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
MONDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
MON OFF SUNRISE OUTSIDE_LIGHTS
MONDAY ON DUSK LIVING_ROOM_LAMP
MONDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
MONDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
MONDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
TUESDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
TUE OFF SUNRISE OUTSIDE_LIGHTS
TUESDAY ON DUSK LIVING_ROOM_LAMP
TUESDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
TUESDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
TUESDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
WEDNESDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
WED OFF SUNRISE OUTSIDE_LIGHTS
WEDNESDAY ON DUSK LIVING_ROOM_LAMP
WEDNESDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
WEDNESDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
WEDNESDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
THU ON SUNSET OUTSIDE_LIGHTS DIM 90
THURSDAY OFF SUNRISE OUTSIDE_LIGHTS
THURSDAY ON DUSK LIVING_ROOM_LAMP
THURSDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
THURSDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
THURSDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
FRIDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
FRI OFF SUNRISE OUTSIDE_LIGHTS
FRIDAY ON DUSK LIVING_ROOM_LAMP
FRIDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
FRIDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
SATURDAY OFF TIME 12:30 AM FAMILY_ROOM_LAMP
SATURDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
SAT OFF SUNRISE OUTSIDE_LIGHTS
SATURDAY ON DUSK LIVING_ROOM_LAMP
SATURDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
SATURDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
SUNDAY OFF TIME 12:30 AM FAMILY_ROOM_LAMP
#EVERYDAY ON TIME 5:45 AM OUTSIDE_LIGHTS DIM 90
EVERYDAY OFF SECURITY TIME 12:30 AM OUTSIDE_LIGHTS
EVERYDAY ON TIME 10:55 PM BEDROOM_LIGHT
EVERYDAY OFF SECURITY TIME 1:30 AM BEDROOM_LIGHT
# The following turns on the Christmas lights at 15 minutes after sunset.
#
# EVERYDAY ON SUNSET OFFSET 15 XMAS_COMPUTER EVENT 25
# EVERYDAY OFF TIME 11:20 PM XMAS_COMPUTER EVENT 26
# EVERYDAY OFF TIME 11:21 PM RED EVENT 21
# EVERYDAY OFF TIME 11:21 PM GREEN EVENT 22
# EVERYDAY OFF TIME 11:21 PM BLUE EVENT 23
# EVERYDAY OFF TIME 11:21 PM WHITE EVENT 24
#
#──────────────────────────────────────────────────────────────────────────────
#
# The following event occurs every Sunday at 3:00 AM.
# When used in conjuction with POWERUP.EXE (in AUTOEXEC.BAT)
# we can automatically download new commands an a weekly basis.
# For example, sunrise and sunset change from day to day. The X10
# computer interface can store these times for 1 week, then it
# needs to be updated with new times.
#
# Additional note: Backups are now performed during this time, as
# well as having all the drives optimized. See the sample
# AUTOEXEC.BAT file supplied with this package.
SUNDAY ON COMPUTER TIME 3:00 AM
# Note: The sample AUTOEXEC.BAT contains the command: XA "A8 OFF"
# after the download, optimizations, and backups have been performed.
# But just in case something went wrong (like leaving a floppy in Drive A),
# we'll have the CP-290 turn the computer off 30 minutes later.
SUNDAY OFF COMPUTER TIME 3:30 AM
# That's all folks.